package cn.itsource.itsource.controller;

import cn.itsource.itsource.domain.Employee;
import cn.itsource.itsource.domain.LinYu;
import cn.itsource.itsource.query.DepartmentQuery;
import cn.itsource.itsource.query.LinYuQuery;
import cn.itsource.itsource.service.ILinYuService;
import cn.itsource.itsource.util.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

@Controller
@RequestMapping("/type")
public class LinYuController {

    @Autowired
    private ILinYuService linYuService;


    @PostMapping("/pagelist")
    @ResponseBody
    public AjaxResult pageList(@RequestBody LinYuQuery query){

        return linYuService.pageList(query);

    }


    @PostMapping("/saveorupdate")
    @ResponseBody
    public AjaxResult saveOrUpdate(@RequestBody LinYu linYu){

        return linYuService.saveOrUpdate(linYu);
    }

    @GetMapping("/del")
    @ResponseBody
    public AjaxResult del(Long id){

        return linYuService.del(id);
    }
}
